package org.example

import scala.io.StdIn

object helloScala {
  def main(args: Array[String]): Unit = {
    println("hello scala!")
    var name = "哪吒"
    var age:Int = 18
    var arr:Array[String] = Array("spark","scala","IDEA")
    println(name)
    println(arr.mkString("Array(",",",")"))
    arr.foreach(println)
    class Student(name:String, var age:Int){
      def printInfo(): Unit = {
        println(name + "" + age + "")
      }
    }
    val nezha = new Student("哪吒",18)
    nezha.printInfo()
    println("请输入用户名：")
    var username:String = StdIn.readLine()
    println("请输入密码：")
    var password:String = StdIn.readLine()
    print(s"欢迎用户${username},您的密码是${password}")
    if (password == "123456"){
      println("登录成功！")
    }else{
      println("密码有误，请重新输入！")
    }
    }
}
